package com.pkq.foure;


import org.apache.commons.lang.StringUtils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class CreateWrite {
    public File creteF(String fileName, String json) throws IOException {
        if (StringUtils.isEmpty(fileName)) {
            return null;
        }
        File file = new File(fileName);


        if (!file.exists()) {
            file.createNewFile();
        }
        FileWriter w = new FileWriter(file);
        w.write(json);
        w.close();

        return file;
    }
}
